from flask import render_template,Flask

app = Flask(__name__)

# 模板html 放在根目录templates 文件夹下
@app.route('/user/<name>')
def index(name):
    return render_template('hello.html', name=name)

@app.route('/template/')
def template():
    name = 'Jinja2 模板引擎'
    myindex = 1
    mylist = [1,2,3,4]
    mydict = {
       'key': 'age',
       'value': '25'
    }
    mytuple = (1,2,3,4)
    return render_template('template.html', name=name, myindex=myindex, mylist=mylist, mydict=mydict, mytuple=mytuple)

'''
有很多模板 Jinjia2 只是举例说明
'''

if __name__ == '__main__':
    app.run()


